package org.javaee113.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @作者 itcast
 * @创建日期 2020/11/2 16:45
 **/
@Configuration
@EnableConfigurationProperties(PersonProperties.class)
public class PersonConfig {
    @Bean
    public Person person(PersonProperties personProperties){
        Person person = new Person();
        person.setId(personProperties.getId());
        person.setPersonName(personProperties.getPersonName());
        return person;
    }
}
